<?php
/***************************************************************
*  Copyright notice
*  (c) 2009, jianyuzhu@gmail.com
*  All rights reserved
*  This script is part of the PPEMI project.
***************************************************************/

//
function func_template_get_templates($limit_start = '0', $limit_length = '20') {
	global $adb;
	
	$query = "select * from templates where templates_status = 1 limit $limit_start, $limit_length";
	$result = $adb->query($query);
		
	while($row = $adb->fetch_array($result)) {
		$rows[] = $row;
	}
	return $rows;
}

function func_template_get_template($templates_id) {
	global $adb;
	
	$query = "select * from templates where templates_id = '" . (int)$templates_id . "' and templates_status = 1";
	$result = $adb->query($query);
		
	$row = $adb->fetch_array($result);
	return $row;
}

//admin
function func_template_add_template() {
	
}

function func_template_delete_template() {
	
}
//
?>